#include "BoneOrientationNodeList.h"

BoneOrientationNodeList::BoneOrientationNodeList()
{
	head = NULL;
}
BoneOrientationNodeList::BoneOrientationNodeList(BoneOrientationNode * headBoneOrientationNode)
{
	head = new List<BoneOrientationNode>(headBoneOrientationNode, NULL);
}
BoneOrientationNodeList::~BoneOrientationNodeList()
{
	printf("Deleting bone orientation node list\n");
	List<BoneOrientationNode> * search = head;
	while(search)
	{
		search = search->Remove();
	}
	printf("Done deleting bone orientation node list\n");
	head = NULL;
}
	
void BoneOrientationNodeList::Add(BoneOrientationNode * payload)
{
	head = new List<BoneOrientationNode>(payload, head);
}

List<BoneOrientationNode> * BoneOrientationNodeList::GetHead()
{
	return head;
}
List<BoneOrientationNode> * BoneOrientationNodeList::GetTail()
{
	List<BoneOrientationNode> * search = head;
	while(search)
	{
		if(!search->next)
			return search;
		search = search->next;
	}
	return NULL;
}

	